@extends('front.layout')
@section('title','名家讲堂')
@section('index')
    <li><a href="/">首页</a></li>
    <li><a class="current"href="/conf">名家讲堂</a></li>
    <li><a href="/expert">名家风采</a></li>
    <li><a  href="/review">往期视频</a></li>
@endsection
@section('content')

<div class="main">
    <div class="online">
        <div class="online_class">
            <div class="online_class_bg"><img src="assets/images/last_time_bg.jpg" /></div>
            <div class="online_class_body">

                @if($counts>0)
                    <?php
                    //php的时间是以秒算。js的时间以毫秒算
                    date_default_timezone_set("Asia/Hong_Kong");//地区
                    $time=strtotime($zvideo->start_at);
                    $current_time=time();//现在的时间
                    $remain = $time-$current_time;//剩余的时间
                    $day= intval($remain/86400);;//天
                    $remains = $remain%86400;
                    $hour = intval($remains/3600);
                    //计算分钟数
                    $remain1 = $remain%3600;
                    $minute = intval($remain1/60);
                    //计算秒数
                    $second = $remain%60;
                    ?>
                    <script language="JavaScript">
                        let runtimes = 0;
                        function GetRTime(){
                            let nMS = <?=$remain?>*1000-runtimes*1000;
                            let nD=Math.floor(nMS/(1000*60*60*24));
                            let nH=Math.floor(nMS/(1000*60*60))%24;
                            let nM=Math.floor(nMS/(1000*60)) % 60;
                            let nS=Math.floor(nMS/1000) % 60;
                            document.getElementById("RemainH").innerHTML=nD;
                            document.getElementById("RemainH").innerHTML=nH;
                            document.getElementById("RemainM").innerHTML=nM;
                            document.getElementById("RemainS").innerHTML=nS;
                            runtimes++;
                            setTimeout("GetRTime()",1000);
                        }
                        window.onload=GetRTime;
                    </script>
                    @if($current_time<$time)


                        <div class="before">
                            <div class="last_time_big">
                                <span class="time1"><strong id="RemainD">00</strong></span>
                                <span class="time2"><strong id="RemainH">00</strong></span>
                                <span class="time3"><strong id="RemainM">00</strong></span>
                                <span class="time4"><strong id="RemainS">00</strong></span>
                            </div>
                            <a class="class_href" href="#"></a>
                        </div>
                        <div class="online_export_box">
                            <div class="online_export_bg"></div>
                            <div class="online_export clearfix">
                                <div class="online_export_ship">
                                    <div class="online_export_img">
                                        <a href="expert/info/{{$experts->id}}"><img src="{{$experts->image}}" /></a>
                                    </div>
                                    @foreach($experts as $v)
                                        <div class="online_export_txt">
                                            <p>专家：{{$v->name}}</p>
                                            <p>医院：{{$v->hos}}</p>
                                            <p>科室：{{$v->ks}}</p>
                                            <p>职称：{{$v->zc}}</p>
                                        </div>
                                        <?php break ?>
                                    @endforeach
                                </div>

                                <!--课程简介-->
                                <div class="online_export_ship border_left">
                                    <div class="online_export_intro">
                                        <p><b>课程简介</b></p>
                                        <p>{{$zvideo->description}}</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    @else
                    <!--会议进行中-->
                        <div class="meeting">
                            <a href="/review/review_info/1">
                                <img src="/assets/images/online_classing.png"/>
                            </a>
                        </div>
                        <div class="online_export_box">
                            <div class="online_export_bg"></div>
                            <div class="online_export clearfix">
                                <div class="online_export_ship">
                                    <div class="online_export_img">
                                        <a href="expert/info/1"><img src="assets/test_images/e2.jpg" /></a>
                                    </div>
                                    @foreach($experts as $v)
                                        <div class="online_export_txt">
                                            <p>专家：{{$v->name}}</p>
                                            <p>医院：{{$v->hos}}</p>
                                            <p>科室：{{$v->ks}}</p>
                                            <p>职称：{{$v->zc}}</p>
                                        </div>
                                        <?php break ?>
                                    @endforeach
                                </div>

                                <!--课程简介-->
                                <div class="online_export_ship border_left">
                                    <div class="online_export_intro">
                                        <p><b>课程简介</b></p>
                                        <p>{{$zvideo->description}}</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    @endif
                @else
                <!--会议结束-->
                    <div class="end_title">会议已结束</div>
                @endif


            </div>
        </div>



        <div class="online_class_share">
            <span>分享到：</span>
            <a href="javascript:void(0)" onclick="erweima()"><img src="/assets/images/icon_weixin.jpg" /></a>
        </div>
    </div>
</div>
<div id="char_pop" class="chat_pop" style="display: none">
    <div id="char_close" class="chat_pop_top"><a onclick="Pop_close()" class="chat_pop_close"></a></div>
    <div class="chat_pop_body">
        <img src="/assets/images/share_ewm.jpg" />
        <p>使用微信扫一扫，并将网页分享给好友</p>
    </div>
</div>
<script>
    function erweima(){
        $.blockUI({
            message:$("#char_pop"),
            css:{border:'none'}
        });
    }
    function Pop_close(){
        $.unblockUI();
    }

</script>
@endsection
